<%--
  Created by IntelliJ IDEA.
  User: EDZ
  Date: 2021/2/25
  Time: 17:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<link rel="stylesheet" href="/static/css/bootstrap/css/bootstrap.css" />

<body>
<a href="/userAdd.jsp" class="btn btn-primary">添加</a>
<table class="table table-bordered">
    <tr>
        <td>序号</td>
        <td>ID</td>
        <td>姓名</td>
        <td>密码</td>
        <td>性别</td>
        <td>创建时间</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${listUser}" var="user" varStatus="status">
        <tr>
            <td>${status.index+1}</td>
            <td>${user.id}</td>
            <td>${user.username}</td>
            <td>${user.password}</td>
            <td>
                <c:choose>
                    <c:when test="${user.sex==1}">男</c:when>
                    <c:when test="${user.sex==0}">女</c:when>
                    <c:otherwise>未知</c:otherwise>
                </c:choose>
            </td>
            <td>
                <fmt:parseDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss" var="createTime" ></fmt:parseDate>
                <fmt:formatDate value="${createTime}" pattern="yyyy年MM月dd日 HH时mm分ss秒"></fmt:formatDate>
            </td>
            <td>
                <a href="/sys/user/delete?id=${user.id}" class="btn btn-danger">删除</a>
                <a href="/sys/user/toUpdate?id=${user.id}" class="btn bg-success">修改</a>
            </td>
        </tr>
    </c:forEach>

</table>
</body>
</html>
